import request from '@/utils/request'



// 授权管理
export function getAuthorizationManagement(params: any) {
    return request.post({ url: '/app/authorization_management', params })
}


// 当前版本
export function getCurrentVersion(params: any) {
    return request.post({ url: '/app/getCurrentVersion', params }, { ignoreCancelToken: true })
}
// 检查新版
export function getGetVersion(params: any) {
    return request.post({ url: '/app/getVersion', params }, { ignoreCancelToken: true })
}
// 应用更新日志
export function getUpdateRecord(params: any) {
    return request.post({ url: '/app/getUpdateRecord', params }, { ignoreCancelToken: true })
}
// 开始更新
export function startUpdate(params: any) {
    return request.post({ url: '/app/startUpdate', params }, { ignoreCancelToken: true })
}
// 开始更新
export function updateStep(params: any) {
    return request.post({ url: '/app/updateStep', params }, { ignoreCancelToken: true })
}
export function getBakSqlFile(params: any) {
    return request.post({ url: '/app/getBakSqlFile', params }, { ignoreCancelToken: true })
}
export function delBakSqlFile(params: any) {
    return request.post({ url: '/app/delBakSqlFile', params }, { ignoreCancelToken: true })
}
export function bakBakSqlFile(params: any) {
    return request.post({ url: '/app/bakBakSqlFile', params }, { ignoreCancelToken: true })
}
export function bakBakAppSqlFile(params: any) {
    return request.post({ url: '/app/bakBakAppSqlFile', params }, { ignoreCancelToken: true })
}
export function reductionBakSqlFile(params: any) {
    return request.post({ url: '/app/reductionBakSqlFile', params }, { ignoreCancelToken: true })
}
export function getAppList(params: any) {
    return request.post({ url: '/app/getAppList', params }, { ignoreCancelToken: true })
}

export function getAppDetail(params: any) {
    return request.post({ url: '/app/getAppDetail', params }, { ignoreCancelToken: true })
}
export function installApp(params: any) {
    return request.post({ url: '/app/installApp', params }, { ignoreCancelToken: true })
}
export function oemedit(params: any) {
    return request.post({ url: '/installapp/oemedit', params }, { ignoreCancelToken: true })
}
/**
 * 所有已购买应用
 * @param params 
 * @returns 
 */
export function getAppEquityAppList(params: any) {
    return request.post({ url: '/app/appEquiteAppList', params }, { ignoreCancelToken: true })
}
/**
 * 更新租户应用
 * @param params 
 * @returns 
 */
export function updateUserApp(params: any) {
    return request.post({ url: '/app/updateUserApp', params }, { ignoreCancelToken: true })
}



// 卸载
export function unloadappDelete(params: any) {
    return request.post({ url: '/unloadapp/delete', params })
}


// 卸载列表
export function unloadappLists(params: any) {
    return request.get({ url: '/unloadapp/lists', params })
}

// 恢复
export function unloadappRestore(params: any) {
    return request.get({ url: '/unloadapp/restore', params })
}

// 彻底卸载
export function unloadappTrueDelete(params: any) {
    return request.post({ url: '/unloadapp/trueDelete', params })
}

//获取类库
export function getClassCurrentVersion(params: any) {
    return request.post({ url: '/appTemp/getClassCurrentVersion', params })
}

//检测类库
export function getClassVersion(params: any) {
    return request.post({ url: '/appTemp/getClassVersion', params })
}
//更新类库
export function updateClassStep(params: any) {
    return request.post({ url: '/appTemp/updateClassStep', params })
}
//获取插件和应用
export function getAppUpdate(params: any) {
    return request.post({ url: '/app/getAppUpdate', params })
}
//安装
export function newInstallapp(params: any) {
    return request.post({ url: '/app/newInstallapp', params })
}

export function apiPayTemplateLists(params: any) {
    return request.get({ url: '/setting.pay.pay_template/lists', params })
}

// 添加支付模板
export function apiPayTemplateAdd(params: any) {
    return request.post({ url: '/setting.pay.pay_template/add', params })
}


// 编辑支付模板
export function apiPayTemplateEdit(params: any) {
    return request.post({ url: '/setting.pay.pay_template/edit', params })
}

// 删除支付模板
export function apiPayTemplateDelete(params: any) {
    return request.post({ url: '/setting.pay.pay_template/delete', params })
}

// 支付模板详情
export function apiPayTemplateDetail(params: any) {
    return request.get({ url: '/setting.pay.pay_template/detail', params })
}

//本地上传文件
export function upload(params: any) {
    return request.post({ url: '/upload/localUpload', params })
}
//获取ip
export function getIp(params: any) {
    return request.get({ url: '/setting.pay.pay_template/getIp', params })
}